package com.yige.common;

import com.google.gson.Gson;
import com.mongodb.DBObject;
import com.mongodb.util.JSON;

import java.util.Map;

/**
 * Created by sunhao on 2015/8/31 0031.
 */
public class ToDBObjectUtil {

    public static DBObject toDBObject(Map<String,Object> info){

        //转换成json字符串，再转换成DBObject对象
        Gson gson=new Gson();
        DBObject dbObject = (DBObject) JSON.parse(gson.toJson(info));
        return dbObject;
    }
}
